package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by chengang on 2017/6/9.
 */

public class UserInfoApi extends BaseApi {

    UserInfoReq req;
    public UserInfoApi(String member_id) {
        req = new UserInfoReq(member_id);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getUserInfo(requestBody);
    }

    class UserInfoReq {
        public String member_id;

        public UserInfoReq(String member_id){
            this.member_id = member_id;
        }
    }
}
